import { createRouter, createWebHistory } from 'vue-router'
import home from '../views/home/index.vue'

const routes = [
  {
    path: '/',
    name: '首页',
    component: home
  },
  {

    path: '/login',
    name: '登录',
    component: () => import('../views/user/login.vue')
  },
  {
    path: '/register',
    name: '注册',
    component: () => import('../views/user/register.vue')
  },
  {
    path: '/blogList',
    name: '博客',
    component: () => import('../views/blog/blogList.vue')
  },
  {
    path: '/blogDetail/:id',
    name: '博客详情',
    component: () => import('../views/blog/blogDetail.vue')
  },
  {
    path: '/about',
    name: '关于',
    component: () => import('../views/about/index.vue')
  },
  {
    path: '/resource',
    name: '资源',
    component: () => import('../views/resource/index.vue')
  },
  {
    path: '/videoList',
    name: '视频',
    component: () => import('../views/video/index.vue')
  },
  {
    path: '/videoDetail/:id',
    name: '视频详情',
    component: () => import('../views/video/detail.vue')
  },
  {
    path: '/userCenter',
    name: '个人中心',
    component: () => import('../views/user/center.vue')
  },
  {
    path: '/examplePublish',
    name: '示例发布',
    component: () => import('../views/exampledemo/publish.vue')
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
